package com.gisocn.onemap.presenter;

import android.util.Log;
import com.gisocn.onemap.base.BasePresenter;
import com.gisocn.onemap.model.ChangeUserPassword;
import com.gisocn.onemap.net.ApiCallback;
import com.gisocn.onemap.view.ChangePassWordView;
import com.google.gson.Gson;
import java.util.Map;

/* loaded from: classes2.dex */
public class ChangePassWordPresent extends BasePresenter<ChangePassWordView> {
    public ChangePassWordPresent(ChangePassWordView changePassWordView) {
        attachView(changePassWordView);
    }

    public void chanagePassWord(Map<String, String> map) {
        addSubscription(this.apiService.chanagePassWord(map), new ApiCallback<ChangeUserPassword>() { // from class: com.gisocn.onemap.presenter.ChangePassWordPresent.1
            @Override // com.gisocn.onemap.net.ApiCallback
            public void onFinish() {
            }

            {
                ChangePassWordPresent.this = this;
            }

            @Override // com.gisocn.onemap.net.ApiCallback
            public void onSuccess(ChangeUserPassword changeUserPassword) {
                Log.e("chanagePassWordSuccess", new Gson().toJson(changeUserPassword));
                if (changeUserPassword.getReturnCode() == 0) {
                    ((ChangePassWordView) ChangePassWordPresent.this.mvpView).success(changeUserPassword);
                } else {
                    ((ChangePassWordView) ChangePassWordPresent.this.mvpView).fail(changeUserPassword.getMessage());
                }
            }

            @Override // com.gisocn.onemap.net.ApiCallback
            public void onFailure(String str) {
                ((ChangePassWordView) ChangePassWordPresent.this.mvpView).fail(str);
            }
        });
    }
}
